<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/eye.css">
    <script>
        window.onload = function () {
            var eye = document.getElementById('eye');
            var pwd = document.getElementById('pwd');
            eye.onclick = function () {
            if(pwd.type == 'password'){
                pwd.type = 'text';
                eye.src = 'images/open.png';
            } 
            else {
            pwd.type = 'password';
            eye.src = 'images/close.png';
            }
        }
    }
    </script>

</head>

<body>
    <div class="box">
        <label>
          <img src="images/close.png" id="eye">
        </label>
        <input type="password" id="pwd">
    </div>

    <!-- <script src="js/eye.js"></script> -->
</body>

</html>